<!DOCTYPE html>
<!-- saved from url=(0027)https://jsoup.org/cookbook/ -->
<html>
<head>
	<meta content="text/html; charset=GBK" http-equiv="Content-Type">
	<title>Cookbook: jsoup Java HTML parser</title>
	<meta content="" name="keywords">
	<meta content="" name="description">
	<meta content="width=device-width, initial-scale=1" name="viewport">
	<link href="./jsoup-cookbook_files/style.css" rel="stylesheet" type="text/css">
	<script async="" src="./jsoup-cookbook_files/analytics.js"></script>
	<script>
    (function (i, s, o, g, r, a, m) {
      i['GoogleAnalyticsObject'] = r;
      i[r] = i[r] || function () {
        (i[r].q = i[r].q || []).push(arguments)
      }, i[r].l = 1 * new Date();
      a = s.createElement(o), m = s.getElementsByTagName(o)[0];
      a.async = 1;
      a.src = g;
      m.parentNode.insertBefore(a, m)
    })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

    ga('create', 'UA-89734-10', 'auto');
    ga('send', 'pageview')

	</script>
</head>
<body class="n1-cookbook">
<div class="wrap">
	<div class="header">
		<div class="nav-sections">
			<ul>
				<li class="n1-home"><h4><a href="https://jsoup.org/">jsoup</a></h4></li>
				<li class="n1-news"><a href="https://jsoup.org/news/">News</a></li>
				<li class="n1-bugs"><a href="https://jsoup.org/bugs">Bugs</a></li>
				<li class="n1-discussion"><a href="https://jsoup.org/discussion">Discussion</a></li>
				<li class="n1-download"><a href="https://jsoup.org/download">Download</a></li>
				<li class="n1-api"><a href="https://jsoup.org/apidocs/">API Reference</a></li>
				<li class="n1-cookbook"><a href="https://jsoup.org/cookbook/">Cookbook</a></li>
				<li class="n1-try"><a href="https://try.jsoup.org/">Try jsoup</a></li>
			</ul>
		</div>
	</div>
	<div class="breadcrumb">
		<a href="https://jsoup.org/">jsoup</a>
		<span class="seperator">&#187;</span> Cookbook
	</div>
	<div class="content">
		<div class="col1">
			<h1>jsoup cookbook</h1>
			<div class="toc">
				<h3>Introduction</h3>
				<ol start="1">
					<li><a href="https://jsoup.org/cookbook/introduction/parsing-a-document">Parsing and traversing a Document</a>
					</li>
				</ol>
				<h3>Input</h3>
				<ol start="2">
					<li><a href="https://jsoup.org/cookbook/input/parse-document-from-string">Parse a document from a String</a>
					</li>
					<li><a href="https://jsoup.org/cookbook/input/parse-body-fragment">Parsing a body fragment</a></li>
					<li><a href="https://jsoup.org/cookbook/input/load-document-from-url">Load a Document from a URL</a></li>
					<li><a href="https://jsoup.org/cookbook/input/load-document-from-file">Load a Document from a File</a></li>
				</ol>
				<h3>Extracting data</h3>
				<ol start="6">
					<li><a href="https://jsoup.org/cookbook/extracting-data/dom-navigation">Use DOM methods to navigate a
						document</a></li>
					<li><a href="https://jsoup.org/cookbook/extracting-data/selector-syntax">Use selector-syntax to find
						elements</a></li>
					<li><a href="https://jsoup.org/cookbook/extracting-data/attributes-text-html">Extract attributes, text, and
						HTML from elements</a></li>
					<li><a href="https://jsoup.org/cookbook/extracting-data/working-with-urls">Working with URLs</a></li>
					<li><a href="https://jsoup.org/cookbook/extracting-data/example-list-links">Example program: list links</a>
					</li>
				</ol>
				<h3>Modifying data</h3>
				<ol start="11">
					<li><a href="https://jsoup.org/cookbook/modifying-data/set-attributes">Set attribute values</a></li>
					<li><a href="https://jsoup.org/cookbook/modifying-data/set-html">Set the HTML of an element</a></li>
					<li><a href="https://jsoup.org/cookbook/modifying-data/set-text">Setting the text content of elements</a></li>
				</ol>
				<h3>Cleaning HTML</h3>
				<ol start="14">
					<li><a href="https://jsoup.org/cookbook/cleaning-html/whitelist-sanitizer">Sanitize untrusted HTML (to prevent
						XSS)</a></li>
				</ol>
			</div>
		</div>
		<!-- /col1 -->
		<div class="col2">
		</div>
		<!-- /col2 -->
	</div>
	<!-- /content-->
	<div class="footer">
		<b>jsoup HTML parser</b> &#169; 2009 - 2016
		<a href="https://jhy.io/" rel="author"><b>Jonathan Hedley</b></a>
	</div>
</div>
<!-- /wrap -->
<script src="./jsoup-cookbook_files/prettify.js"></script>
<script>prettyPrint()</script>

</body>
</html>
